home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / m68k / fbug68k.arc / FBUG.DOC < prev    next >
Text File  |  1989-09-29  |  55KB  |  1,327 lines

  1. MONITOR
  2.  
  3.  
  4. Rev 1.1
  5. Release Date
  6. September 28,1989
  7.  
  8.  
  9.  
  10.             ******** DISCLAIMER ********
  11.  
  12. The FBUG monitor is the sole property of Motorola Inc. This software may be
  13. distributed in whole or in part as public domain software. This software is 
  14. provided as is and in no event shall Motorola, Inc. be liable for any direct, 
  15. special, incidental, or consequential damages arising out of or connected with
  16. a users poseesion or use of this software package, even if Motorola has advance
  17. notice of the possibility of such damages.
  18.  
  19. Comments, questions or suggestions may be directed, in writing only, to:
  20.  
  21.         Microprocessor Products Applications
  22.         6501 William Cannon Drive West 0E33
  23.         Austin, Texas 78735-8598
  24.  
  25.             *****************************
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. TABLE OF CONTENTS
  36.  
  37. 1.      GENERAL INFORMATION
  38. 1.1     Description of FBUG.......................      3
  39.  
  40.  
  41. 2.      THE FBUG COMMAND SET
  42. 2.1     Introduction..............................      4
  43.  2.2     Assembler/Disassembler (as) ..............      6
  44. 2.3     Block of Memory Fill (bf).................      6
  45. 2.4     Block of Memory Move (bm).................      6
  46. 2.5     Break Point (br)..........................      6
  47. 2.6     Block Search (bs).........................      7
  48. 2.7     Confidence Test (ct)......................      7
  49. 2.8     Data Conversion (dc)......................      7
  50. 2.9     Go (go)...................................      7
  51. 2.10    Help (?/he/help)..........................      8
  52. 2.11    Load S-Records (lo).......................      8
  53. 2.12    Memory Display (md).......................      8
  54. 2.13    Memory Modify (mm)........................      9
  55. 2.14    Register Display (rd).....................      10
  56. 2.15    Register Modify (rm)......................      10
  57. 2.16    Symbol Define (sd)........................      10
  58. 2.17    Transparent Mode (tm).....................      10
  59. 2.18    Trace (tr)................................      11
  60.  
  61. 3       USING THE ONE-LINE ASSEMBLER/DISASSEMBLER
  62. 3.1     Introduction  ............................      12
  63. 3.2     Entering and Modifying Source Program ....      12
  64. 3.3     Entering a Source Line....................      12
  65. 3.4     Entering Branch and Jump Addresses........      14
  66. 3.5     Entering Register Lists ..................      15
  67. 3.6     Entering Floating Point Immediate Data ...      15
  68. 3.7     Entering MMU Instructions ................      15
  69.  
  70.  
  71. 4       SOFTWARE MODIFICATIONS
  72. 4.1     Introduction .............................     16
  73. 4.2     Adding/Deleting Commands .................     16
  74. 4.3     Switching Drivers ........................     17
  75.  
  76. 5       TARGET SYSTEM CONFIGURATION
  77. 5.1     Introduction .............................     17
  78. 5.2     Assembler/Disassembler ...................     18
  79. 5.3     Memory Requirements ......................     18
  80.  
  81. 6    LINKING INFORMATION    
  82. 6.1    Introduction .............................    19    
  83. 6.2    Description of FBUG (68xxx) Makefile .....    19
  84. 6.3    Monitor used to boot the system ..........    19
  85.  
  86. 7    ERROR REPORTING 
  87. 7.1    Error Listing .............................    19    
  88.  
  89. CHAPTER 1
  90. GENERAL INFORMATION
  91.  
  92.  
  93. 1.1     DESCRIPTION OF FBUG(68xxx)
  94.  
  95. The FBUG monitor is a stand alone software package designed to assist in
  96. evaluating/debugging systems which use the 68xxx Microprocessor.  It has the
  97. capability to load and execute user code and includes an assembler/disassembler
  98. designed for quick program patchwork.  The monitor operates in a user-
  99. interactive command driven mode signified by the MOTOROLA> prompt.  The
  100. command line entered after this prompt determines which operation is
  101. performed.
  102.  
  103.  
  104.  
  105. CHAPTER 2
  106. THE FBUG COMMAND SET
  107.  
  108. 2.1     INTRODUCTION
  109.  
  110. This chapter explains the FBUG monitor commands and their associated syntax.
  111. Table 2.1 summarizes the available commands and shows the section where the
  112. command is explained in greater detail. 
  113.  
  114.                         TABLE 2.1  FBUG MONITOR COMMANDS
  115.  
  116. Command Mnemonic        Name                    Section
  117.  
  118.  
  119.         as      Assembler/Disassembler          2.2
  120.         bf      Block of Memory Fill            2.3
  121.         bm      Block of Memory Move            2.4
  122.         br      Breakpoint                      2.5
  123.         bs      Block of Memory Search          2.6
  124.         ct      Confidence Test                 2.7
  125.         dc      Data Conversion                 2.8
  126.         go      Go                              2.9
  127.  ?/he/help      Help                            2.10
  128.         lo      Load S-Records                  2.11
  129.         md      Memory Display                  2.12
  130.         mm      Memory Modify                   2.13
  131.         rd      Register Display                2.14
  132.         rm      Register Modify                 2.15
  133.         sd      Symbol Define                   2.16
  134.         tm      Transparent Mode                2.17
  135.         tr      Trace                           2.18
  136.  
  137.  
  138.  
  139. The command line is composed of:
  140.  
  141.         <COMMAND IDENTIFIER>: specifies which command (ex. br )
  142.         <SP>: at least one space
  143.         OPTION LIST: an option delimiter(-) with options if non-default options
  144.                         are allowed and are being used. (ex. [<-r>])
  145.         <SP>: at least one space
  146.         ARGUMENTS: any required arguments specified by the command separated
  147.                         by commas/spaces as shown in the command description.
  148.                         (ex. <ADDR,ADDR>)
  149.  
  150.  
  151. where "<>" enclose symbols that are required on the command line and "[<>]" 
  152. enclose symbols that are optional on the command line.  Note, in the above 
  153. examples the -r option was an example of an optional symbol and that the ADDR 
  154. fields are requirements on the command line.  The options available with a given
  155. command are fully explained in the section that describes that command.  The 
  156. monitor is not case sensitive to input from the terminal. All input from the 
  157. terminal is converted to lower case before being used internally (except text 
  158. following a text delimiter; See TEXT below).  The arguments of a given command 
  159. are described using the following symbols:
  160.  
  161.  
  162. <EXP>: An expression can be any numerical expression which may be
  163.        evaluated using only the arithmetic + and - operators.
  164.  
  165.                  Ex.     1000
  166.                  Ex.     1+3
  167.                  Ex.     13+/reset   NOTE: where /reset has been
  168.                                            predefined (see section 2.16 )
  169.  
  170. Note: Numbers may be preceded with a base designator if the default
  171. (hexadecimal) is not desired. These designators are shown below in
  172. Table 2.2:
  173.  
  174.                         TABLE 2.2  BASE DESIGNATORS
  175.  
  176.                         _______________________
  177.                         Base         Designator
  178.                         _______________________
  179.  
  180.                         Hexadecimal     $
  181.                         Decimal         &
  182.                         Octal           @
  183.                         Binary          %
  184.  
  185. <ADDR>: Address field is any valid expression. Note: This address field should
  186.         not be confused with the source and destination addresses required
  187.         using the Assembler/Disassembler.
  188.  
  189. <COUNT>: Count field is any valid expression preceded by a COUNTDEL (count
  190.         delimiter ie. ":")
  191.  
  192.                 Ex.     :100
  193.  
  194. <RANGE>: A range of memory locations denoted by either ADDR,ADDR or ADDR:COUNT.
  195.  
  196.                 Ex.     0,100
  197.                 Ex.     0:50
  198.  
  199.  
  200. <TEXT>: An ASCII string of up to 255 characters preceded by a TEXTDEL (text
  201.         delimiter ie. ";")
  202.  
  203.                 Ex.     ;sample text
  204.  
  205. <SIZE>: Can be either:
  206.                 byte    (8   bit)       ====> -b
  207.                 word    (16  bit)       ====> -w
  208.                 long    (32  bit)       ====> -l
  209.  
  210.                 Note: ====> stands for "is represented by" or "returns"
  211.  
  212. <DATA>: Data can be any valid expression.
  213.  
  214. <MASK>: A mask may be any expression.  After evaluating the expression 0's
  215.         represent don't cares.  A mask is sometimes used to qualify
  216.         <DATA>. See section 2.6 for an example of usage.
  217.  
  218.  
  219. 2.2     ASSEMBLER/DISASSEMBLER
  220.         as <ADDR>
  221.  
  222. The assembler/disassembler is invoked at the address given and disassembles
  223. the object code at that location.  Use of the Assembler/Disassembler is fully
  224. described in chapter 3.
  225.  
  226.  
  227.  2.3    BLOCK OF MEMORY FILL
  228.         bf [<SIZE>] <RANGE> <DATA>
  229.  
  230. The block fill command fills the specified range of memory with the data listed.
  231. If the size option is not specified the default size used is word.  If a 
  232. multiple of the <SIZE> of <DATA> does not fit evenly in the <RANGE> the command 
  233. leaves the last partial word or long word unchanged. 
  234.  
  235.         Examples of use:
  236.  
  237.         bf 100,110      &10
  238.         bf 100:8        &10
  239.         bf -w 100:8     a
  240.         bf -l 100,110   a000a
  241.  
  242.         Note: All of these examples perform the same memory fill.
  243.           (ie.  $00000100: $000a $000a $000a $000a $000a $000a
  244.                 $0000010C: $000a $000a $0000 $0000 $0000 $0000 )
  245.  
  246. 2.4     BLOCK OF MEMORY MOVE
  247.         bm [<SIZE>] <RANGE> <ADDR>
  248.  
  249. The block move command allows the user to copy segments of memory to different
  250. locations in memory. The execution of this command does not destroy the original
  251. version unless the location moved to <ADDR> is within the range <RANGE> of the
  252. code being copied.  The size option is only available when range is described as
  253. <ADDR>:<COUNT> .  If range is being described with the <ADDR>,<ADDR>  mode the
  254. size defaults to byte. The size field represents the size transfer that is used
  255. to accomplish the memory move.
  256.  
  257.  
  258.         Examples of use:
  259.  
  260.         bm 1000,2000    10000
  261.         bm 1000:800     10000
  262.         bm -l 1000:400  10000   Note: This variation executes the fastest
  263.  
  264.         Note: All of these examples perform the same memory move.
  265.  
  266. 2.5     BREAKPOINT
  267.         br
  268.         br <ADDR>
  269.         br <ADDR> <:COUNT>
  270.         br -r [<ADDR>]
  271.         br -r
  272.  
  273. The breakpoint command allows the user to list, insert or delete breakpoints in 
  274. the target code. This allows the user to stop executing a program and return to the monitor environment when the specified <ADDR> is prefetched.  The different 
  275. uses of this command are summarized below:
  276.  
  277.         br                              list all known breakpoints
  278.         br <ADDR>                       insert a breakpoint at this address
  279.         br <ADDR> <:COUNT>              insert a breakpoint at this address
  280.                                         ,however, return to the monitor
  281.                                         environment only after encountering the
  282.                                         breakpoint <COUNT> number of times.
  283.         br -r [<ADDR>]                  remove the breakpoint at this address
  284.         br -r                           remove all breakpoints
  285.  
  286.  
  287. 2.6     BLOCK SEARCH
  288.         bs [<SIZE>] <RANGE> <DATA>
  289.         bs [<SIZE>] <RANGE> <DATA> <MASK>
  290.  
  291.  
  292. The block search command allows the user to find a specific pattern within 
  293. memory.  The search area may extend beyond the <RANGE> specified if a pattern is
  294. started within <RANGE>.  There are two primary types of searches:
  295.  
  296.         bs [<SIZE>] <RANGE> <DATA>              searches the range for an
  297.                                                 exact match of <DATA>.
  298.         bs [<SIZE>] <RANGE> <DATA> <MASK>       searches the range for any
  299.                                                 pattern that matches <DATA>
  300.                                                 where there is a "1" in the
  301.                                                 binary representation of
  302.                                                 the mask.
  303.  
  304.     Ex. With memory at location $100 as shown below, executing
  305.         "bs 100,118 $1234 $ffbf" ====>
  306.  
  307.         Starting address: $00000100
  308.         Ending   address: $00000117
  309.         Found at: $00000110:$1234
  310.         Found at: $00000114:$1274
  311.  
  312.  
  313.         Memory for the example above:
  314.  
  315.             $00000100: $0000 $0000 $0000 $0000 $0000 $0000
  316.             $0000010C: $0000 $0000 $1234 $0000 $1274 $0000
  317.  
  318.  
  319. 2.7     CONFIDENCE TEST
  320.         ct
  321.  
  322. The confidence test command allows the user to perform a confidence test of the 
  323. system being evaluated. This command is designed to write a -1 into the result 
  324. variable (int confres in vardef.h) of the confidence test and then pass the 
  325. address of this variable in register a0 to a called subroutine. This routine 
  326. writes a 0 or 1 into confres depending on whether the test passes or fails
  327. respectively. If the routine does not place a valid result in this variable
  328. then the monitor assumes that the confidence test was not performed and displays
  329. "ERROR 14:Unable to perform Confidence Test".  The confidence test to be
  330. performed is system dependent and has to developed for the system on
  331. which the monitor is running.
  332.  
  333.  
  334. 2.8     DATA CONVERSION
  335.         dc <EXP>
  336.  
  337. The data conversion command allows the user to evaluate an input expression and 
  338. determine its hexadecimal and decimal equivalent.
  339.  
  340.         Examples of use:
  341.  
  342.         NOTE:   The following symbols have been defined earlier in order
  343.         fpr them to be used in the examples below:
  344.         EX 1.   uses    /start= 0           
  345.                 Ex 2.   uses    /start= - $18
  346.                 Ex 3.   uses    /finish= 10000 and /start=$10000
  347.         (see section 2.17 )
  348.  
  349.         Ex. 1   dc $17+/start      ====>   $17 = &23
  350.         Ex. 2   dc $17+/start      ====>   UNSIGNED  :  $FFFFFFFF = &4294967295
  351.                                              SIGNED    :        -$1 = -&1
  352.         Ex. 3   dc $/finish-/start ====>   $10000 = 65536
  353.  
  354.  
  355. 2.9     GO
  356.         go [<ADDR>]
  357.  
  358. The go command allows the user to execute target programs. If an address is not
  359. specified on the command line then the current PC value is used.This value is 
  360. either 1.)the initialized PC value if no target code has been run,2.)the last
  361. value of the PC used in executing target code or 3.)the value placed into the PC
  362. register by a RM command (Register Modify see section 2.16 ). If an address is 
  363. included on the command line then the PC is modified to be the specified addr. 
  364. and execution begins at this address.  In both cases, the register state that 
  365. the microprocessor is intialized to, before executing the target code at this
  366. location, can be viewed by executing a rd command (See section 2.15).
  367.  
  368.  
  369. 2.10    HELP
  370.         ?    [<symbol>]
  371.     he   [<symbol>]
  372.         help [<symbol>] 
  373.  
  374. The help command allows the user to view a list of allowable commands and the
  375. syntax associated with them.  Symbols used to describe the command usage can be 
  376. looked up also.
  377.  
  378.         Examples of use:
  379.  
  380.         ?,he or help ====>  return a complete listing of all commands with usage
  381.         ? as         ====>  AS <addr>
  382.         help addr    ====>  <number>
  383.         he number    ====>  <hex> || <dec> || <oct> || <bin> || <symbol>
  384.  
  385.                 Note: <number> may also be an expression
  386.  
  387. 2.11    LOAD S-RECORD
  388.         lo [<OFFSET>] ;<TEXT>
  389.  
  390. The load command allows the user to download S-Records from the host system.  If
  391. an offset is present on the command line then the target address is the offset 
  392. added to the address determined by the S-Record. This command sends the <TEXT> 
  393. beyond the ";" to the HOST.  It then expects the HOST to begin sending S-Records
  394. to the terminal.
  395.  
  396.         Examples of use:
  397.  
  398.         lo ;cat fbug.mx
  399.  
  400. Note:   The "cat" command is a UNIX command that concatenates and then prints
  401.         the specified files using standard output. This effectively sends 
  402.     the contents of the file to the terminal. The monitor then loads the
  403.     contents of the S-Records in the file to the addresses determined by 
  404.     the S-Records.
  405.  
  406.         lo a0000 ;cat fbug.mx
  407.  
  408.                 Note:     This command downloads the same S-Record file used
  409.             in the first example except that it is down loaded 
  410.             into memory at the address determined by the 
  411.             S-Record + $a0000 (ie. the offset is added in).
  412.  
  413. 2.12    MEMORY DISPLAY
  414.         md [<SIZE>]  <addr>
  415.         md [<SIZE>]  <RANGE>
  416.         md -di <addr>
  417.  
  418. The memory display command allows the user to view memory.  The size used to dis
  419. play the memory is determined by the size option.  If no option is used the 
  420. default is word.  If the range exceeds the screen capacity, output to the screen
  421. is suspended until any key is pressed.
  422.  
  423.         Examples of use:
  424.  
  425.         md -l 100,110
  426.         md -l 100:4
  427.         md 100:8
  428.         md -di 100    Note: This command begins to disassemble the memory at
  429.                   this location.
  430.  
  431.  
  432.  
  433. 2.13    MEMORY MODIFY
  434.         mm [<SIZE>]  <ADDR>
  435.         mm <CONTROL>
  436.  
  437. The memroy modify command allows the user to view and modify memory.  The size 
  438. used to display the memory is determined by the size option.  The size default 
  439. is word.  Memory is displayed beginning at the address specified followed by a 
  440. '?' prompt.  The user may type in an <exp> to replace that memory value or hit 
  441. return to view the next memory value.  To exit the command, type ". <cr>" 
  442. (period <carriage return>).  Other available <CONTROL> characters are summarized
  443. below in Table 2.3:
  444.  
  445.                         TABLE 2.3  CONTROL CHARACTERS
  446.  
  447.                         __________________________________
  448.                         Control Character       Designator
  449.                         __________________________________
  450.  
  451.                         - <EXP>                 backup  <EXP> memory locations
  452.                         + <EXP>                 advance   "     "     "
  453.  
  454.         Examples of use:
  455.  
  456.         mm -l 100 ====> $00000100 $00000000 ?
  457.         mm 100    ====> $00000100 $0000 ?        
  458.         (ie. uses the default "word" size)
  459.  
  460.  
  461.  
  462. 2.14    REGISTER DISPLAY
  463.         rd
  464.         rd -f   Note: Only valid if Coprocessor support has been specified
  465.               see below.
  466.  
  467. The register display command allows the user to view the contents of the 
  468. registers of the mpu/fpu.  Versions released before August 30,1989 only 
  469. supported the 68020 programmers model and did not support the coprocessor 
  470. (68881/882) programmers model.  Versions released after August 30,1989 support 
  471. the programmers model that the user specifies before compiling the monitor.  
  472. This is done by using the DEVICE,EMULATOR and COPROCESSOR "define" statements in
  473. the "targetsys.h" header file. These defines are discussed further in the 
  474. "Target System Configuration" section. The values shown for the registers are 
  475. either 1.) the initialized register state if no target code has been run, 2.) 
  476. the last values in the registers  while executing target code or 3.) the values 
  477. specifically placed into the registers by a rm command.  
  478.  
  479.  
  480. 2.15    REGISTER MODIFY
  481.         rm [<REGISTER> [<New Value>]]
  482.  
  483.  
  484. The RM command allows the user to the modify the contents of the registers of 
  485. the mpu. 
  486.  
  487.         Examples of use:
  488.  
  489.         To change the PC value:
  490.  
  491.         rm pc 3000      ====>   changes the PC value to 3000
  492.  
  493.                 or
  494.  
  495.         rm              ====>   Which register?
  496.         pc              ====>   PC=00004000NEW VALUE?
  497.         3000            ====>   changes the PC value to 3000
  498.  
  499.                 or
  500.  
  501.         rm pc           ====>   PC=00004000NEW VALUE?
  502.         3000            ====>   changes the PC value to 3000
  503.  
  504.  
  505.  
  506.  
  507. 2.16    SYMBOL DEFINE
  508.         sd [<SYMBOL>  <EXP>]
  509.         sd -r <SYMBOL>
  510.  
  511.  
  512. The symbol define command allows the user to define symbols.  These symbols can 
  513. then be used within expressions. Using a symbol in an expresion results in the 
  514. symbol being substituted with the expresion that was used to define it.  Once 
  515. defined, the symbol is available until the monitor is reset.  If a symbol is 
  516. defined multiple times the monitor uses the first definition.
  517.  
  518.  
  519.         Examples of use:
  520.  
  521.         sd              ====>   lists which symbols are already
  522.                                 known
  523.         sd /reset 10000 ====>   defines /reset to be $10000
  524.                                 whenever it is used in an expression.
  525.         sd /start -$18  ====>   defines /start to be -$18
  526.                                 whenever it is used in an expression.
  527.         sd -r /start    ====>   removes the first definition of /start
  528.                                 from the list
  529.  
  530.         NOTE:   Symbols that have been defined using the sd command can
  531.                 be used in any expressions. An example of this is to
  532.                 use a symbol defined to enter source code while in
  533.                 the assembler (ie.  bsr    /startsub     after defining
  534.                 /startsub).
  535.  
  536. 2.17    TRANSPARENT MODE
  537.         tm
  538.  
  539. The transparent mode command places the user into transparent mode by 
  540. establishing a software connection between the HOST and TERMINAL.  Transparent 
  541. mode preempts normal communication between the TERMINAL and the debugger. While 
  542. in this mode all keyboard input is relayed directly to the HOST. HOST responses,
  543. in turn, are returned to the screen. Typing a CTRL A returns the user to the 
  544. monitor environment.
  545.  
  546.  
  547. 2.18    TRACE
  548.         tr [<ADDR>][<COUNT>]
  549.  
  550. The trace command allows the user to trace though target code and observe the 
  551. registers after executing the command line.  If count is specified then the 
  552. microprocessor executes <COUNT> number of instructions before returning to the 
  553. monitor environment.  Trace begins from the <ADDR> listed on the command line or
  554. from the current PC if an <ADDR> is not included.  The trace instruction can be
  555. continued by hitting a carriage return.  To exit, a "." must be entered.
  556.  
  557.         Examples of use:
  558.  
  559.         tr              ====>  traces 1 instruction from the current PC
  560.         tr :10          ====>  executes 10 instructions past the current
  561.                                   PC then returns to the monitor
  562.                                   environment
  563.         tr 1000         ====>  traces 1 instruction starting at $1000
  564.  
  565.  
  566.  
  567.  
  568. CHAPTER 3
  569. USING THE ONE-LINE ASSEMBLER/DISASSEMBLER
  570.  
  571.  
  572. 3.1     INTRODUCTION
  573.  
  574. Included in the FBUG monitor is an assembler/disassembler command which can
  575. be executed as detailed in the previous chapter.  This assembler/disassembler
  576. allows the user to modify target code.  Each source line that is typed in by the
  577. user is entered into memory at the displayed address.  This line is then
  578. disassembled so that the user can verify the actual code entered into memory. If
  579. no change is desired a <CR> moves the user to the next opcode in memory.
  580.  
  581. NOTE:   The instruction set that is available to the user is determined when
  582.     the monitor is compiled. The choice of the values of DEVICE, EMULATOR
  583.     and COPROCESSOR determine which instruction set is available.
  584.     See the "Target System Configuration" section below.
  585.  
  586. CAUTION:  This assembler/disassembler does not insert code into the source
  587.           program; it merely overwrites memory at that location.  As a
  588.           result, a program patch that requires code insertion can be
  589.           accomplished by first Block Moving code to free up an insertion
  590.           area and then inserting into that area.
  591.  
  592. 3.2     ENTERING AND MODIFYING SOURCE PROGRAM
  593.  
  594. In order to enter and modify source code, the as command should be executed as
  595. detailed in section 2.2 (ie. as <ADDR>).  This places the user into the
  596. Assembler/Disassembler routine.  Table 3.1 summarizes the commands that can
  597. be executed within this routine:
  598.  
  599.                 TABLE 3.1  ASSEMBLER/DISASSEMBLER SUB COMMANDS
  600.  
  601.                         __________________________________
  602.                         Command                 Designator
  603.                         __________________________________
  604.  
  605.                         BACKUP <EXP>                    - <EXP>
  606.                         ADVANCE <EXP>                   + <EXP>
  607.                         FINISH                          .
  608.                         HELP                            ?
  609.                         STEP PAST               carriage return
  610.             DEFINE CONSTANT            DC #<EXP>
  611.  
  612. Note: Executing a '?' while in the assembler/disassembler returns the DEVICE
  613.       that the assembler/disassembler is supporting.
  614.  
  615. 3.3     ENTERING A SOURCE LINE
  616.  
  617. After executing an as <ADDR> command, the assembler/disassembler 
  618. returns with the disassembly of the code found at that location.  At this
  619. time the user may execute an assembler command shown in section 3.2 or type in
  620. the source line that is to replace the displayed source code.  While entering
  621. source the standard MOTOROLA effective addressing modes are used.  These modes
  622. are summarized below in Table 3.2:
  623.  
  624.  
  625.  
  626. TABLE 3.2  ASSEMBLER/DISASSEMBLER EFFECTIVE ADDRESSING MODES
  627.  
  628.  
  629.  
  630. Effective Addressing Mode                               Syntax
  631.  
  632.  
  633. Register Direct                                 Dn
  634. Address register direct                         An
  635. Address register indirect                       (An)
  636. Address register indirect
  637.           with Postincrement                    (An)+
  638. Address register indirect
  639.           with Predecrement                     -(An)
  640. Address register indirect
  641.           with Displacement                     (d16,An)
  642. Address register indirect
  643.           with Index (d8)                       (d8,An,Xn.SIZE*SCALE)
  644. Address register indirect
  645.           with Index (base displacement)        (bd,An,Xn.SIZE*SCALE)
  646. Memory indirect Post-indexed                    ([bd,An],Xn.SIZE*SCALE,od)
  647. Memory indirect Pre-indexed                     ([bd,An,Xn.SIZE*SCALE],od)
  648. PC indirect with displacement                   (d16,PC)
  649. PC indirect with index (d8)                     (d8,PC,Xn.SIZE*SCALE)
  650. PC indirect with index (bd)                     (bd,PC,Xn.SIZE*SCALE)
  651. PC memory indirect Post-indexed                 ([bd,PC],Xn.SIZE*SCALE,od)
  652. PC memory indirect Pre-indexed                  ([bd,PC,Xn.SIZE*SCALE],od)
  653. Absolute Short Address                          (xxx).W
  654. Absolute Long Address                           (xxx).L
  655. Absolute Address                                xxx optimizes (bwl)
  656. Immediate Data                                  #xxx
  657.  
  658.  
  659.  
  660. While using the POST or PRE indexed modes, fields may be skipped by using a
  661. comma.  An example is shown below:
  662.  
  663.         Ex.     andi #12,([,],,)                ====>
  664.                                 andi.b #$12,([$0,ZA0],ZD0.W*1,$0)
  665.  
  666. Other examples of source lines are shown below:
  667.  
  668.         Ex.     ori.l  #12,(a1)                 =====>  ori.l #$12,(a1)
  669.  
  670.         Ex.     addq    #1,(a1)                 =====>  addq.b #$1,(a1)
  671.  
  672. There are only limited error screening abilities included within the monitor.
  673. Examples of this are shown below:
  674.  
  675.         Ex.     jmp (123).w                     ====>   jmp ($123).W
  676.  
  677.                         Note:     When executed results in a bus error.
  678.  
  679.         
  680.     Ex.     bsr (123) ====> 
  681.  
  682.     ERROR 10:illegal change of flow ===> bsr (123)
  683.  
  684.             Note:     The bsr instruction does check for illegal 
  685.                       changes of flow.  
  686.  
  687.     NOTE:    Flow may not be changed to an odd addr.
  688.  
  689. Upper digits of data are NOT truncated when a mismatch between size and 
  690. immediate data is found if the byte or word size option was specifically 
  691. entered. If the long size option is specified and data exceeds this range then 
  692. upper digits ARE truncated.
  693.  
  694.     Ex.    addi.b #12345678,(a1) ====> 
  695.  
  696.     ERROR 11:immediate data/size option error ===> addi.b #12345678,(a1)
  697.  
  698.     Ex.    addi.l #123456789,(a1) ====>  addi.l #$23456789,(a1)
  699.     Ex.    addi   #123456789,(a1) ====>  addi.l #$23456789,(a1)
  700.             (defaults to the long option)
  701.                 truncated--------------^
  702.  
  703. Upper digits of data are truncated on commands that have a limited field
  704. in the opword to store the immediate data. Examples of this are shown below.
  705.  
  706.         Ex.     addq    #10,(d0)        =====>  addq.b #$0,(d0)
  707.  
  708.         Ex.     trap    #10             =====>  trap #$0   input is hex default
  709.  
  710.         Ex.     trap    #&10            =====>  trap #$A
  711.  
  712.  
  713.  
  714. 3.4     ENTERING CHANGE OF FLOW INSTRUCTIONS
  715.  
  716. Since the assembler/disassembler does not use labels, all instructions that use
  717. <label> as an effective addressing mode must have their displacement determined.
  718. If initially unknown,  space for this displacement must be reserved and then the
  719. user needs to come back and enter the displacement.  Once the displacement
  720. has been determined it may be entered as shown in the following example:
  721.  
  722. Ex. In this example the location of the target instruction of a branch is known
  723. to be $100000 and a BRA is needed at location 0.  After executing "AS 0" and 
  724. obtaining the disassembly found at 0 the user could type:
  725.  
  726.                 BRA     100000          or
  727.                 BRA     (100000)        or
  728.                 BRA.l   #ffffe
  729.  
  730. The absolute addressing mode can be used if the target address of a branch is
  731. known (as in the first 2 examples) or the displacement (last example) can be 
  732. entered using the immediate data addressing mode. 
  733.  
  734.  
  735. CAUTION:      In some instances unexpected results can occur while using 
  736.         change of flow statements.  These instances are summarized below
  737.         with examples.
  738.  
  739. Ex. 1  If the degenerate case of a branch statement in used (ie. attempting to
  740. use a short branch to branch to the following instruction) the assembler 
  741. mistakenly assembles this .b option.  However, since the displacement is zero
  742. this is a .w opcode and the disassembler correctly displays this fact to the
  743. user.
  744.  
  745.         $00004000       nop  ? bra.b  ====> results in an INCORRECT assembly
  746.  
  747. Ex. 2  If the user attempts to force a particular size branch statement and the
  748. actual branch requires a greater displacement than was reserved then the
  749. assembler prints an error message: "ERR0R 16:  OUT OF DISPLACEMENT RANGE" .
  750.  
  751.         $00004000       nop  ?bra.w (100000)
  752.  
  753. One way to assure this does not occur is to not enter a size option.  This 
  754. allows the assembler to choose the correct size for the displacement.
  755.  
  756.  
  757.  
  758. 3.5 ENTERING REGISTERS and REGISTER LISTS
  759.  
  760. The move multiple register instruction (movem) uses a register list as an 
  761. effective address.  This list may be entered in the following method:
  762.  
  763.     Ex.
  764.  
  765.         a0                      ====>   single address register
  766.         d3                      ====>   single data register
  767.         a0-a3                   ====>   series of registers
  768.         a0-a3/a7                ====>   combination of previous examples
  769.         a0-a7/d0-d7             ====>   all of the registers
  770.  
  771.     If coprocessor support is specified  then the floating point registers
  772.     can be entered as shown below: 
  773.  
  774.     Ex.
  775.  
  776.         fp0                      ====>   single floating point register
  777.         fp0-fp2                  ====>   series of registers
  778.         fp0-fp3/fp7              ====>   combination of previous examples
  779.  
  780. Many of the commands require the entering of registers other than data or
  781. address registers.  Tables 3.3-8 show listings of the registers that are used
  782. and the abbreviations accepted by the assembler:
  783.  
  784.                         TABLE 3.3  68000/68HC000/68008 REGISTERS
  785.  
  786.                 ____________________________________________
  787.                 Name                                    Syntax
  788.                 ____________________________________________
  789.                 User Stack Pointer                      USP
  790.                 Program Counter                         PC
  791.                 Condition Code Register                 CCR
  792.                 Supervisor Stack Pointer                SSP
  793.                 Status Register                         SR
  794.  
  795.                         TABLE 3.4  68010 REGISTERS
  796.  
  797.                 ____________________________________________
  798.                 Name                                    Syntax
  799.                 ____________________________________________
  800.                 User Stack Pointer                      USP
  801.                 Program Counter                         PC
  802.                 Condition Code Register                 CCR
  803.                 Supervisor Stack Pointer                SSP
  804.                 Status Register                         SR
  805.                 *Vector Break Register                  VBR
  806.                 *Source Function Code Register          SFC
  807.                 *Destination Function Code Register     DFC
  808.  
  809.         Note: * Represents a change from the previous
  810.             model
  811.  
  812.                         TABLE 3.5  68020 REGISTERS
  813.  
  814.                 ____________________________________________
  815.                 Name                                    Syntax
  816.                 ____________________________________________
  817.                 User Stack Pointer                      USP
  818.                 Status Register                         SR
  819.                 Condition Code Register                 CCR
  820.                 Program Counter                         PC
  821.                 *Master Stack Pointer                   MSP
  822.                 *Interrupt Stack Pointer                ISP
  823.                 Vector Break Register                   VBR
  824.                 Source Function Code Register           SFC
  825.                 Destination Function Code Register      DFC
  826.                 *Cache Control Register                 CACR
  827.                 *Cache Address Register                 CAAR
  828.                 _____________________________________________
  829.  
  830.                         TABLE 3.6  68030 REGISTERS
  831.  
  832.                 ____________________________________________
  833.                 Name                                    Syntax
  834.                 ____________________________________________
  835.                 User Stack Pointer                      USP
  836.                 Status Register                         SR
  837.                 Condition Code Register                 CCR
  838.                 Program Counter                         PC
  839.                 Master Stack Pointer                    MSP
  840.                 Interrupt Stack Pointer                 ISP
  841.                 Vector Break Register                   VBR
  842.                 Source Function Code Register           SFC
  843.                 Destination Function Code Register      DFC
  844.                 Cache Control Register                  CACR
  845.                 Cache Address Register                  CAAR
  846.                 *CPU Root Pointer Register              CRP
  847.                 *Supervisor Root Pointer Register       SRP
  848.                 *Translation Control Register           TC
  849.                 *Transparent Translation Register 0     TT0
  850.                 *Transparent Translation Register 1     TT1
  851.                 *MMU Status Register                    PSR
  852.                 _____________________________________________
  853.  
  854.                         TABLE 3.7  68040 REGISTERS
  855.  
  856.                 ____________________________________________
  857.                 Name                                    Syntax
  858.                 ____________________________________________
  859.                 User Stack Pointer                      USP
  860.                 Status Register                         SR
  861.                 Condition Code Register                 CCR
  862.                 Program Counter                         PC
  863.                 Master Stack Pointer                    MSP
  864.                 Interrupt Stack Pointer                 ISP
  865.                 Vector Break Register                   VBR
  866.                 Source Function Code Register           SFC
  867.                 Destination Function Code Register      DFC
  868.                 Cache Control Register                  CACR
  869.                 Cache Address Register                  CAAR
  870.                 User Root Pointer Register              URP
  871.                 Supervisor Root Pointer Register        SRP
  872.                 Translation Control Register            TC
  873.                 *Data Transparent Translation Register 0 DTT0
  874.                 *Data Transparent Translation Register 1 DTT1
  875.                 *Instruction Transparent Trans. Reg.   0 ITT0
  876.                 *Instruction Transparent Trans. Reg.   1 ITT1
  877.                 MMU Status Register                     PSR
  878.         
  879.         Note: Also the floating point registers below
  880.                 _____________________________________________
  881.  
  882.                         TABLE 3.8  FLOATING POINT REGISTERS
  883.  
  884.                 ____________________________________________
  885.                 Name                                    Syntax
  886.                 ____________________________________________
  887.                 Floating Point Control Register         FPCR
  888.                 Floating Point Status Register          FPSR
  889.                 Floating Point Inst. Address Register   FPIAR
  890.                 Floating Point Data Register            FP0-FP7
  891.  
  892. NOTE:    PMMU (68851) support is not available under release 1.0.    
  893.  
  894.  
  895. 3.6 ENTERING/EVALUATING FLOATING POINT IMMEDIATE DATA
  896.  
  897. Floating point immediate data must be entered using a decimal point with at 
  898. least one (1) digit in front of the decimal place (even if it is a '0'). 
  899. Ex. 0.0012.  Since the C compiler used was not based on the draft proposed 
  900. version of ANSI C the software is incapable of performing the 'assembling' of 
  901. extended immediate data to extended precision. The monitor makes the correct
  902. conversion up to double precision and places this result in an extended 
  903. format.  If the compiler that is being used does conform to allowing a 
  904. 'long double' type then changing the type of the variable 'weight' in the 
  905. EAallowed routine (in the asm68.c file) from double to long double should 
  906. provide the added precision.  Examples of floating point immediate data shown
  907. below:
  908.  
  909.     Ex.  fmove.s #5.0,fp0    ====> fmove.s 1_400000_E_2,FP0
  910.  
  911. The format on the disassembly is integer part_fraction field_E_exponent field,
  912. where the fraction bits represent weighting of 1/2 ,1/4,....etc. from the left
  913. to the right.  The exponent bits represent the unbiased power that 2 should be
  914. raised to. A conversion to decimal can be accomplished by evaluating:
  915.  
  916.     integer + evaluated fraction  x 2^exponent field
  917.  
  918. In the above example this equates to:
  919.  
  920.       (1 + .25) x 2^2 = 5.0
  921.  
  922. NOTE:  The monitor uses the round toward zero rounding mode in the assembler 
  923.        when assembling floating point immediate data.
  924.  
  925. 3.7 ENTERING MMU INSTRUCTIONS
  926.  
  927. MMU instruction should NOT be entered with a size descriptor.  The assembler 
  928. defaults to the correct size.
  929.  
  930.     Ex. pmove (a0),tt1     ;asssembles
  931.  
  932.         pmove.l (a0),tt1     ;does not assemble even though the operation
  933.                 ;is a long operation. 
  934.  
  935. A summary of the mnemonic representation of the MMU registers can be found in
  936. Table 3.5 and 3.6 for the 68030 and 68040 monitors respectively.
  937.  
  938. CHAPTER 4
  939. SOFTWARE MODIFICATIONS
  940.  
  941.  
  942. 4.1     SOFTWARE OVERVIEW
  943.  
  944.  
  945. The FBUG monitor uses 4 header files.  These header files are briefly described
  946. below.  
  947.  
  948. TARGETSYS.H
  949. This file is the header file that is used to configure the monitor to the
  950. target system. All of the predefined variables that are used by the monitor
  951. are found here.  It is accessed when any call to #include "userdef.h" is
  952. made.
  953.  
  954. USERDEF.H
  955. This is the file that defines all of the structures that are used by 
  956. the monitor.
  957.  
  958. TEXTDEF.H
  959. This file has all of the strings that are used by the monitor.  It is also
  960. where most of the structures that are used by the monitor are implemented.
  961.  
  962.  
  963. VARDEF.H
  964. This file has all of the global variables that are used by the monitor.
  965.  
  966.  
  967. The flow of the FBUG monitor is outlined below:
  968.  
  969. asmstartport.s ===> coldstartport.c ===> main.c ----|
  970.                         ^-------|
  971.  
  972. The first source file (asmstartport.s) initializes the microprocessor to a 
  973. known state and then branches to the main{} statement in the coldstartport.c 
  974. routine.  The coldstartport.c routine performs all of the initialization for the
  975. monitor before branching to the mainloop{} routine in the main.c file.  The 
  976. mainloop{} routine is a continuous loop used by the monitor.  From this loop 
  977. the various commands of the monitor are called.
  978.  
  979.  
  980. 4.2     ADDING/DELETING COMMANDS
  981.  
  982.  
  983. The process of adding or deleting commands from the monitor is a relatively
  984. simple process.  Adding a command involves making 2 additions to the textdef.h 
  985. header file and then developing/including the command description file with the 
  986. monitor.
  987.  
  988. The two changes that need to be made to the textdef.h header file are:
  989.  
  990. 1.) include the function name that implements the command as an externally
  991. defined routine. For example the line in the textdef.h file that states
  992.  
  993. extern trcmd(),pfcmd(),ascmd(),sdcmd(),ctcmd();
  994.  
  995. accomplishes this for those five commands.
  996.  
  997.  
  998. 2.) include the command in the f[] structure with the appropriate information.
  999. For an example of how this is done the "ct" command entry is discussed:
  1000.  
  1001. The line
  1002.  
  1003. {"ct Confidence Test \n",ctcmd,"ct \n"}
  1004.  
  1005. includes the ct command in the f[] structure.  The first textstring (ie. ct 
  1006. Confidence Test \n) is the string that is used for the command listing print 
  1007. out performed when the help or ? commands are executed.  Also, the first word 
  1008. of this string is the command name that is searched for when attempting to 
  1009. execute this command.  The function name "ctcmd" is the name of the function 
  1010. that is executed when this command is used by the monitor.  The last text 
  1011. string (ie. ct \n) is the string that describes the type of syntax used with 
  1012. this command.
  1013.  
  1014. Next, the command description file has to be written and included in the
  1015. makefile of the monitor (see CHP6 LINKING INFORMATION for more information 
  1016. concerning the linking process). The calling convention for the functions which
  1017. perform the command is to pass the function two parameters. These two parameters
  1018. are argc and argv.  They are the number of arguments on the command line and the
  1019. actual command line respectively.  
  1020.  
  1021. Deleting a command is accomplished by following an analogous path. Removing 
  1022. the 2 lines that incorporate a command into the monitor and removing the command
  1023. from the linking process effectively remove the command from the monitor.
  1024.  
  1025.  
  1026. 4.3     SWITCHING DRIVERS
  1027.  
  1028. The I/O driver used by the monitor in version 1.0 is for a MC68681 DUART. If the
  1029. target system uses some other driver, then the following changes needs to
  1030. be made:
  1031.  
  1032. 1.)     The DUART initialization performed in coldstartport.c has to be
  1033.         modified to accomplish the same results with the new driver.
  1034.  
  1035. 2.)     The user definitions associated with the new driver has to be
  1036.         updated in the targetsys.h file.  (ie. the offsets to the various 
  1037.     buffers of the new driver)
  1038.  
  1039. 3.)     It may be necessary to modify the getch and putch routines found in
  1040.         getline.c and print.c respectively.
  1041.  
  1042.  
  1043.  
  1044. CHAPTER 5
  1045. TARGET SYSTEM CONFIGURATION 
  1046.  
  1047. 5.1 INTRODUCTION
  1048.  
  1049. The FBUG monitor can be configured to support any of the 68xxx microprocessors.
  1050. This is accomplished by a series of define statements found within the 
  1051. "targetsys.h" header file.  By defining which configuration is supported 
  1052. additional software can be excluded from the code at compilation time to 
  1053. result in a smaller monitor. These space savings are generally accomplished 
  1054. based on the size of the assembler/disassembler for the associated 
  1055. configuration.  The monitor can also be configured to a specific memory 
  1056. configuration.  
  1057.  
  1058.  
  1059. 5.2   ASSEMBLER/DISASSEMBLER
  1060.  
  1061. The assembler/disassembler supported in the 'AS' command is determined by the 
  1062. definiton of the DEVICE, EMULATOR and COPROCESSOR variables found in the 
  1063. targetsys.h header file. The choices for DEVICE are 68000,68008,68010,68020,
  1064. 68030 or 68040. This also determines the programmer's model that is supported in
  1065. the 'RD' and 'RM' commands. If the DEVICE selected is '68040' then the EMULATOR
  1066. define is used to determine whether 68881/68882 commands not implemented in 
  1067. hardware should be supported. Placing a 'TRUE' here stipulates that all 
  1068. 68881/882 instructions should be supported. If there is no software emulation of
  1069. these commands then a 'FALSE' should be placed here. If the DEVICE selected is 
  1070. either 68020 or 68030 then the COPROCESSOR (TRUE or FALSE) define statement 
  1071. determines whether the 68881/882 instruction set should be supported.
  1072.  
  1073. Note: As of release 1.0 the 68040 register model is visible but supervisor
  1074.       registers other than those implemented on the 68020 are not supported.
  1075.       As a result of this the monitor displays the entire 68040 register set 
  1076.       and APPEARS to allow the user to modify these registers with a RM command.
  1077.       However, when executing target code (GO or TR command) the monitor does
  1078.       NOT use these values to intialize the state of the microprocessor
  1079.       before executing the target code.  In addition, these registers are NOT
  1080.       captured by the monitor if they have been modified by target code. 
  1081.  
  1082.  
  1083. 5.3    MEMORY REQUIREMENTS 
  1084.  
  1085. The "targetsys.h" file contains all of the variables that determine the 
  1086. target system configuration.  These variables are listed below and 
  1087. needs to be changed to reflect the configuration of the target 
  1088. system.
  1089.  
  1090. /* ******************************************************************** */
  1091. /* ********************** MEMORY MAP FOR DEBUGGER ********************* */
  1092.  
  1093. #define DUARTALOC 0xffe02000    /* MC68681 duart channel a */
  1094. #define DUARTBLOC 0xffe02008    /* MC68681 duart channel b */
  1095.  
  1096. #define ROMLOC 0x100000        /* system ROM space            */
  1097.                 /* .text segment should be loaded here    */
  1098.                 /* .data segment should be loaded here    */
  1099.  
  1100. #define SYSRAMLOC  0x000fe000    
  1101.                 /* system RAM space             */
  1102.                 /* NOTE: space must be reserved for the
  1103.                      location of the .bss used by
  1104.                      the monitor.            */
  1105.                 /* Provided the .bss is not larger than
  1106.                    1000 (ie. VBRLOC resides at SYSRAMLOC 
  1107.                    + 1000) placing the .bss from the 
  1108.                    monitor at this location is allowed     */
  1109.  
  1110. #define ISPLOC SYSRAMLOC+0x2000 /* defines for monitor     */
  1111. #define MSPLOC SYSRAMLOC+0x1c00
  1112. #define USPLOC SYSRAMLOC+0x1b00
  1113. #define VBRLOC SYSRAMLOC+0x1000
  1114.  
  1115. #define USERPCLOC 0x4000     /* defines for usercode    */
  1116. #define USERVBRLOC 0x0
  1117.  
  1118. /* *********************************************************************** */
  1119. #if(DEVICE<68020)
  1120. #define USERSSPLOC USERVBRLOC+0x2000    /* Note: Only one of these is
  1121.                          used based on the device
  1122.                          being implemented */
  1123. #else
  1124. #define USERISPLOC USERVBRLOC+0x2000
  1125. #endif
  1126. /* *********************************************************************** */
  1127.  
  1128. #define USERMSPLOC USERVBRLOC+0x1c00
  1129. #define USERUSPLOC USERVBRLOC+0x1b00
  1130.  
  1131. #define SRSTART 0x2700        /* status register    */
  1132.  
  1133. ******************************************************************************
  1134.  
  1135.  
  1136. The DUART assumed is a MC68681 and its respective channels are found 
  1137. at the stated locations.  If this is not the case, then the initialization 
  1138. routine in coldstartport.c has to be changed.  
  1139.  
  1140. The next 5 locations describe the memory map of the system used for the port. 
  1141.  
  1142. The next location describes the value that is placed in the VBR register.
  1143.  
  1144. NOTE:     This is the location of the vector offset table. This space is used
  1145.     by the monitor to set up the offset table. 
  1146.  
  1147. The next 5 locations describe the initial values that the monitor 
  1148. uses for "user code". 
  1149.  
  1150. The next location describes the value that is placed in the user's VBR 
  1151. register.
  1152.  
  1153. NOTE: This is the location of the user's vector offset table and is
  1154.       also initialized by the monitor.
  1155.  
  1156. SRSTART is the initialized value of the  MC68xxx Status Register 
  1157.  
  1158.  
  1159. CHAPTER 6
  1160. LINKING INFORMATION 
  1161.  
  1162. 6.1 INTRODUCTION
  1163.  
  1164. The FBUG monitor is a stand alone software package written in C 
  1165. and developed under the UNIX environment.  The combined .text and .data  
  1166. section of the object file varies from approx. 54K to 87  bytes of memory. 
  1167. Different configurations are summarized below in Table 6.1.  The purpose of this
  1168. chapter is to describe the method to compile and link the various files that 
  1169. make up the FBUG monitor.  There is also a brief description of the necessary 
  1170. changes that need to be made in order to port the FBUG monitor to a MC68xxx 
  1171. based board.  
  1172.  
  1173.                  TABLE 3.3  68000/68HC000/68008/68010 REGISTERS
  1174.  
  1175.                 ____________________________________________
  1176.         DEVICE    COPROCESSOR    EMULATOR    SIZE (KB)
  1177.                 ____________________________________________
  1178.     68000/008/010    ----NA-----    ---NA---    54K    
  1179.         68020          FALSE    ---NA---    61K
  1180.         68020           TRUE    ---NA---    81K
  1181.         68030          FALSE    ---NA---    65K
  1182.         68030           TRUE    ---NA---    87K
  1183.         68040    ----NA-----       FALSE    82K
  1184.         68040    ----NA-----        TRUE    84K
  1185.  
  1186.     NOTE:     ----NA---- represents a don't care
  1187.         for that particular DEVICE.
  1188.  
  1189.                 ____________________________________________
  1190.  
  1191.  
  1192. 6.2    DESCRIPTION OF FBUG(68xxx) MAKEFILE
  1193.  
  1194. The makefile used to create the FBUG monitor under the UNIX 
  1195. operating system is shown below and can be found in the file named 
  1196. "makefile" in this directory.
  1197.  
  1198. MAKEFILE
  1199.  
  1200. portbug : coldport.o main.o printport.o getlineport.o general.o \
  1201.     asmprocport.o \
  1202.     bf.o bm.o br.o bs.o dc.o he.o lo.o rd.o rm.o tm.o \
  1203.     mm.o md.o go.o tr.o sd.o as.o asm68.o disasm68.o asmcode68.o \
  1204.     asmhandler.o handler.o  asmstartport.o conf.o fproutines.o 68def.o 
  1205.     ld ./ifilemb  asmstartport.o asmhandler.o coldport.o \
  1206.     printport.o getlineport.o general.o asmprocport.o main.o bf.o bm.o \
  1207.     bs.o dc.o he.o lo.o rd.o rm.o tm.o mm.o md.o go.o tr.o br.o \
  1208.     sd.o as.o disasm68.o asm68.o asmcode68.o handler.o conf.o \
  1209.     fproutines.o  68def.o \
  1210.     -m -o fbugxxxd >memmap
  1211.     ubuilds fbugxxxd
  1212.  
  1213. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1214. NOTE: In fbugxxxd     xxx ===> 000,008,010,020 etc...
  1215.             d ===> T or F for whether Coprocessor supported
  1216. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1217.  
  1218. main.o :    main.c userdef.h textdef.h vardef.h
  1219.     :
  1220.     :
  1221.     :
  1222.     :
  1223.     :
  1224. asmproc.o : asmproc.c userdef.h textdef.h vardef.h
  1225.  
  1226. asmstartport.o : textdef.h vardef.h userdef.h targetsys.h
  1227.         /lib/cpp asmstartport.s  > temp.s
  1228.         as  -o asmstartport.o temp.s
  1229.         rm temp.s
  1230. asmcode68.o : textdef.h vardef.h userdef.h targetsys.h
  1231.         /lib/cpp asmcode68.s  > temp.s
  1232.         as  -o asmcode68.o temp.s
  1233.         rm temp.s
  1234. asmhandler.o : textdef.h vardef.h userdef.h targetsys.h
  1235.         /lib/cpp asmhandler.s  > temp.s
  1236.         as  -o asmhandler.o temp.s
  1237.         rm temp.s
  1238.  
  1239. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1240.     NOTE:     In order to ease the porting of the monitor to a 
  1241.         specific system, a C preprocessor is executed on the 
  1242.         three (3) .s files above.  This performs a text 
  1243.         substitution into these files from the targetsys.h
  1244.         header file.  If the development system being used does
  1245.         not support this capability then these text substitutions
  1246.         must be made manually.
  1247. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1248.  
  1249. Executing the "make" command under UNIX with this makefile 
  1250. produces the file "fbug.mx" which is the stand alone monitor.  
  1251. The make command performs the following actions:
  1252.  
  1253. 1.    Checks to see if all of the current .o files on which 
  1254. fbugxxxd depends are current.  If not then compile the 
  1255. source files to create those object files.  It also checks 
  1256. to verify that the files on which these files depend on
  1257. are up to date.  If they are not then they are 
  1258. compiled first.
  1259.  
  1260.  
  1261. /* ******************************!!!!!!!!!********************************* */
  1262. NOTE: These dependencies are not conclusive and if a change is made to any of
  1263.       the header files then all of the files should be recompiled until
  1264.       a thorough understanding of the interdependencies between the modules
  1265.       is achieved.
  1266.  
  1267. /* ******************************!!!!!!!!!********************************* */
  1268.  
  1269.  
  1270. 2.    After all the required .o files have been brought up to 
  1271. date they are linked together in the order described 
  1272. after the "ld" command.  The "ifilemb" file is used as a ld 
  1273. directive to describe the memory configuration of the 
  1274. target system.  In this instance, the target system has 
  1275. the following memory configuration:
  1276.  
  1277.     00000000-00000255    RAM
  1278.     000FE000-00100000    RAM
  1279.     00100000-00110000    ROM
  1280.  
  1281.     The ifilemb informs the UNIX linker of this target 
  1282. configuration and also where to place each section.  In 
  1283. this instance the .text section is being placed into ROM 
  1284. and the .data and .bss section are being placed in RAM.  
  1285. Refer to the "ifilemb" file in this directory.
  1286.  
  1287. /* ******************************!!!!!!!!!********************************* */
  1288. NOTE: Space has to be made available for both the monitor's vector offset 
  1289.       table and the user's vector offset table. (ie. 256 32-bit words has 
  1290.       to be available at locations VBRLOC and USERVBRLOC. 
  1291.       (ie.  00000000-00000255    RAM)
  1292. NOTE: The monitor uses approx. $1000Kb ram for the .bss variables (placed
  1293.       at SYSRAMLOC). Next the vector offset table is placed at SYSRAMLOC +
  1294.       $1000. Then the stack space used by the monitor is placed above this.
  1295.       Using the default configuration provided requires that approx. $2500 
  1296.       bytes of RAM be reserved for the monitor begining at location SYSRAMLOC
  1297.       and that 256 32-Bit words be reserved at the USERVBRLOC (which
  1298.       is at location 0 in the released version).  If user code is run then 
  1299.       the user is responsible for making sure that the stack space used by 
  1300.       the user does not interfer with the monitors space.
  1301. /* ******************************!!!!!!!!!********************************* */
  1302.  
  1303. 3.    These files are now linked and this file is labeled "fbugxxxd"
  1304.  
  1305. 4.    Next, the "ubuilds fbugxxxd" command creates an S-Record 
  1306. from the fbug file that was previously created.  This S-
  1307. Record can be used to download to systems that have the 
  1308. capability to load S-Records.
  1309.     
  1310.  
  1311. The environment that is being worked under has to be able to perform the 
  1312. functions stated above in order for the user to create their FBUG object file.
  1313.  
  1314.  
  1315. 6.3    MONITOR USED TO BOOT THE SYSTEM
  1316.  
  1317. If it is desired for the monitor to be at the reset location (ie. logical 
  1318. 0 in memory)  then the following two lines should be added above 
  1319. the start: routine in the asmstartport.s file:
  1320.  
  1321. INITSP:    long 0x100000
  1322. INITPC    long start
  1323.  
  1324. NOTE:  The ifilemb directive must still accurately reflect the 
  1325. location of ROM on the system.
  1326.  
  1327.